package cn.yj.core.business.service.iservice;

import cn.yj.cgs.dba.entity.IntegralGoods;
import cn.yj.cgs.dba.entity.IntegralGoodsType;
import cn.yj.cgs.dba.entity.vo.IntegralGoodBuyVo;
import cn.yj.cgs.dba.entity.vo.IntegralGoodVo;
import cn.yj.common.baseDao.MpIService;

import java.util.List;

/**
 * @author 永健
 * @since 2021-05-09 12:37
 */
public interface IIntegralGoodsService extends MpIService<IntegralGoods> {

    boolean addGoods(IntegralGoodVo integralGoodVo);

    boolean updateGoodsByCode(IntegralGoodVo integralGoodVo);

    /**
     * 积分购买/兑换
     * 注意： 预防商品库存多减
     * for update
     *
     * @param buyVo 积分商品编号
     */
    boolean goBuy(IntegralGoodBuyVo buyVo);

    List<IntegralGoodsType> getGoodsType();

    IntegralGoods getDetail(String goodsNo);

    IntegralGoods selectByGoodsNoForUpdate(String goodsNo);
}
